/*******************************************************************************
*   			Impacts of a Large-Scale Parenting Program: 				   *
*					Experimental Evidence from Chile						   *
********************************************************************************


	REQUIRES:	"$dt_int/baseline_for figures.dta"
	CREATES:	${out_tables}/F1A_base_childcog_careg.eps
				
	WRITEN BY:  Italo Lopez  [italolop@usc.edu]

********************************************************************************
	Prepare data
*******************************************************************************/

	* Load data
	use "$dt_int/baseline_for figures.dta", clear



/*******************************************************************************
*   Set macros for regressions
*******************************************************************************/
	
	* Var labels 
	
	* Plot settings 
	*--------------------------------- 
	set scheme white_tableau
	graph set window fontface "Times New Roman"
	global graph_pref "graphregion(color(white) margin(vsmall)) "

/*******************************************************************************
	Figure A1: Baseline child cognitive development and primary caregiver education
*******************************************************************************/



** PLSIV vs Educ **
twoway (lowess t_score pc_yrsch_old if inrange(edadtramos,1,6), lcolor(black)),/*
*/ ytitle("PLSIV t-score",  size(medium)) /*
*/ xtitle("Primary caregiver years of schooling", size(medium)) /*
*/ xlabel(0(5)25, valuelabel nogrid ) ylab(,nogrid) /*
*/ title("a. Language t-score (PLSIV) vs. Caregiver education", size(medlarge) ) /*
*/ name(F1A_a, replace) $graph_pref ytitle("PLSIV Normalized t-score; First successful trial")

** AnotB vs Educ **
twoway (lowess piag_fsuc_old pc_yrsch_old if inrange(edadtramos,1,6), lcolor(black)), /*
*/ ytitle("First successful trial", size(medium) ) /*
*/ xtitle("Primary Caregiver Years of Schooling", size(medium)) /*
*/ xlabel(0(5)25, valuelabel nogrid) ylabel(, nogrid) /*
*/ title("b. Executive function (A not B) vs. Caregiver education", size(medlarge)) /*
*/ name(F1A_b, replace) $graph_pref ytitle("PLSIV Normalized t-score; First successful trial")

	graph combine F1A_a F1A_b, rows(1) xsize(7)
	gr export "$out_graphs/appendix/F1A_base_childcog_careg.eps", replace
	gr export "$out_graphs/appendix/F1A_base_childcog_careg.wmf", replace 
	gr export "$out_graphs/appendix/F1A_base_childcog_careg.png", replace 

	
	
